//
//  MKReadUpView.m
//  ManKeCartoon
//
//  Created by dllo on 15/10/21.
//  Copyright © 2015年 ManKe. All rights reserved.
//

#import "MKReadUpView.h"

@implementation MKReadUpView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self createButton];
        
    }
    return self;
}

#pragma mark - 收藏按钮 到 目录上面
-(void)createButton
{
    // 收藏按钮
    self.ScollectButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.ScollectButton setTitle:@"添加收藏" forState:UIControlStateNormal];
    [self.ScollectButton setTitle:@"已收藏" forState:UIControlStateSelected];
    [_ScollectButton setFrame:CGRectMake(10, 10, (self.frame.size.width - 30) / 2, 40)];
    [_ScollectButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [_ScollectButton setTitleColor:[UIColor grayColor] forState:UIControlStateSelected];
    [_ScollectButton.layer setMasksToBounds:YES];
    [_ScollectButton.layer setCornerRadius:10];
    [_ScollectButton.layer setBorderWidth:1];
    [_ScollectButton.layer setBorderColor:[UIColor grayColor].CGColor];
    _ScollectButton.titleLabel.font = [UIFont systemFontOfSize:18];
    [self addSubview:_ScollectButton];
    
    // 看到哪集
    self.SlxLastup = [UIButton buttonWithType:UIButtonTypeCustom];
    //[_SlxLastup setTitle:@"第1话" forState:UIControlStateNormal];
    [_SlxLastup setFrame:CGRectMake(_ScollectButton.frame.size.width + 20, 10, (self.frame.size.width - 30) / 2, 40)];
    [_SlxLastup setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_SlxLastup setBackgroundColor:[UIColor colorWithRed:0.90 green:0.2 blue:0.15 alpha:1]];
    _SlxLastup.titleLabel.font = [UIFont systemFontOfSize:18];
    [_SlxLastup.layer setMasksToBounds:YES];
    [_SlxLastup.layer setCornerRadius:10];
    [self addSubview:_SlxLastup];
    
    //评分栏
    self.ScroeButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_ScroeButton setFrame:CGRectMake(10, _ScollectButton.frame.origin.y + 60, (self.frame.size.width - 20)/3, 50)];
    [_ScroeButton setImageEdgeInsets:UIEdgeInsetsMake(5, _ScroeButton.frame.size.width / 2 - 10, _ScroeButton.frame.size.height - 30,_ScroeButton.frame.size.width / 2 - 10 )];
    [_ScroeButton setTitleEdgeInsets:UIEdgeInsetsMake(30, -25, 0, 0)];
    _ScroeButton.titleLabel.font = [UIFont systemFontOfSize:13];
    [_ScroeButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    _ScroeButton.layer.borderColor = [UIColor grayColor].CGColor;
    [_ScroeButton setImage:[UIImage imageNamed:[NSString stringWithFormat:@"PFFF.png"]] forState:UIControlStateNormal];
    [_ScroeButton.layer setBorderWidth:.5];
    [_ScroeButton.layer setBorderColor:[UIColor grayColor].CGColor];
    [_ScroeButton setTitleColor:[UIColor colorWithRed:0.90 green:0.2 blue:0.15 alpha:1] forState:UIControlStateNormal];
    [self addSubview:_ScroeButton];
    
    self.FXbutton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_FXbutton setFrame:CGRectMake(10 + _ScroeButton.frame.size.width, _ScollectButton.frame.origin.y + 60, (self.frame.size.width - 20)/3, 50)];
    [_FXbutton setImageEdgeInsets:UIEdgeInsetsMake(5, _FXbutton.frame.size.width / 2 - 10, _FXbutton.frame.size.height - 30,_FXbutton.frame.size.width / 2 - 10 )];
    [_FXbutton setTitleEdgeInsets:UIEdgeInsetsMake(30, -25, 0, 0)];
    _FXbutton.titleLabel.font = [UIFont systemFontOfSize:13];
    [_FXbutton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    _FXbutton.layer.borderColor = [UIColor grayColor].CGColor;
    [_FXbutton setImage:[UIImage imageNamed:[NSString stringWithFormat:@"FXXX.png"]] forState:UIControlStateNormal];
    [_FXbutton.layer setBorderWidth:.5];
    [_FXbutton.layer setBorderColor:[UIColor grayColor].CGColor];
    [_FXbutton setTitleColor:[UIColor colorWithRed:0.90 green:0.2 blue:0.15 alpha:1] forState:UIControlStateNormal];
    [self addSubview:_FXbutton];
    
    self.YPbutton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_YPbutton setFrame:CGRectMake(_FXbutton.frame.size.width + _FXbutton.frame.origin.x, _ScollectButton.frame.origin.y + 60, (self.frame.size.width - 20)/3, 50)];
    [_YPbutton setImageEdgeInsets:UIEdgeInsetsMake(5, _YPbutton.frame.size.width / 2 - 10, _YPbutton.frame.size.height - 30,_YPbutton.frame.size.width / 2 - 10 )];
    [_YPbutton setTitleEdgeInsets:UIEdgeInsetsMake(30, -25, 0, 0)];
    _YPbutton.titleLabel.font = [UIFont systemFontOfSize:13];
    [_YPbutton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    _YPbutton.layer.borderColor = [UIColor grayColor].CGColor;
    [_YPbutton setImage:[UIImage imageNamed:[NSString stringWithFormat:@"YPPP.png"]] forState:UIControlStateNormal];
    [_YPbutton.layer setBorderWidth:.5];
    [_YPbutton.layer setBorderColor:[UIColor grayColor].CGColor];
    [_YPbutton setTitleColor:[UIColor colorWithRed:0.90 green:0.2 blue:0.15 alpha:1] forState:UIControlStateNormal];
    [self addSubview:_YPbutton];
    
    
    
    
}
@end
